package com.sys.ai.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.sys.common.annotation.Excel;
import com.sys.common.core.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author LGY
 * Create by 2025/5/19 10:16
 */
@Data
@Accessors(chain = true)
@TableName(value = "ai_apps")
@Schema(description = "AI应用对象")
public class AiApps extends BaseEntity implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "ID")
    private String id;
    /**
     * 应用图标
     */
    @Excel(name = "应用图标")
    @TableField(value = "img_url", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "应用图标")
    private String imgUrl;
    /**
     * 应用名称
     */
    @Excel(name = "应用名称")
    @TableField(value = "name", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "应用名称")
    private String name;
    /**
     * 工作流id
     */
    @Excel(name = "工作流id")
    @TableField(value = "workflow_id", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "工作流id")
    private String workflowId;
    /**
     * 模型编码
     */
    @Excel(name = "模型Id")
    @TableField(value = "model_id", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "模型Id")
    private String modelId;
    /**
     * 提示词
     */
    @Excel(name = "提示词")
    @TableField(value = "prompt", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "提示词")
    private String prompt;
    /**
     * 对话提示集合
     */
    @Excel(name = "对话提示集合")
    @TableField(value = "user_tips", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "对话提示集合")
    private String userTips;
    /**
     * 最大tokens 1 <= x <= 16384   默认512
     */
    @TableField(value = "max_tokens", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "最大tokens 1 <= x <= 16384   默认512")
    private Integer maxTokens;


    @TableField(value = "temperature", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "温度（确定响应中的随机程度） 0 <= x <= 2.0 默认0.7")
    private BigDecimal temperature;

    @TableField(value = "top_p", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "top_p（确定响应中的随机程度） 0.1 <= x <= 1.0 默认0.7")
    private BigDecimal topP;

    @Schema(description = "预测标记选择数(参数用于根据累积概率动态调整每个预测标记的选择数。) 0 <= x <= 100 默认50")
    @TableField(value = "top_k", updateStrategy = FieldStrategy.ALWAYS)
    private Integer topK;

    /**
     * 挂载知识库id集合
     */
    @Excel(name = "挂载知识库id")
    @TableField(value = "knowledge_id", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "挂载知识库id")
    private String knowledgeId;

    @TableField(value = "has_llm_render", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "知识库输出内容是否需要LLM渲染 N：否 Y：是")
    private String hasLlmRender;
    /**
     * 状态 0：待发布 1：已发布
     */
    @Excel(name = "状态 0：待发布 1：已发布")
    @TableField(value = "status", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "状态 0：待发布 1：已发布")
    private Integer status;
    /**
     * 备注
     */
    @Excel(name = "备注")
    @TableField(value = "remark", updateStrategy = FieldStrategy.ALWAYS)
    @Schema(description = "备注")
    private String remark;

    @TableField(exist = false)
    private String modelName;

    @TableField(exist = false)
    private String flowName;
}